package org.ww.member.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.ww.common.utils.R;
import org.ww.member.feign.OrderFeignService;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: gmall
 * @description:
 * @author: ww
 * @create: 2024-11-01 17:59
 **/
@Controller
public class MemberWebController {

    @Autowired
    private OrderFeignService orderFeignService;
    @GetMapping("/memberOrder.html")
    public String memberOrderPage(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                                  Model model){
        Map<String,Object> map = new HashMap<>();
        map.put("page",pageNum.toString());
        R r = orderFeignService.listWithItem(map);
        model.addAttribute("orders",r);
        //返回用户订单列表
        return "orderList";
    }

}
